package com.myzk.example.runner;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

@Component
@Order(1)
public class StartupLoggingRunner implements CommandLineRunner {
    private Logger logger = LoggerFactory.getLogger(getClass());

    @Value("${server.port}")
    private String serverPort;

    @Value("${server.servlet.context-path}")
    private String contextPath;

    @Override
    public void run(String... args) throws Exception {
        logger.info("----Service startup----port:[{}] contextPath:[{}]-----",serverPort,contextPath);
    }
}
